package com.itheima.demo04;

public class Demo_Swimming {
    public static void main(String[] args) {
        goSwimming(() -> System.out.println("一起去爬山;"));
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("还有没有机会!");
            }
        });

        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("给你摆个姿势!");
            }
        });

    }
    public static void goSwimming(Swimming swimming){
        swimming.swim();
    }
}
interface Swimming{
    void swim();
}
